<%@ include file="/common/taglibs.jsp"%>
<head>
    <title><fmt:message key="quick.title"/></title>
    <script type="text/javascript" src="<c:url value='/ext/scripts/index/index.js'/>"></script>
</head>
<script type="text/javascript"
	src="<c:url value='/ext/scripts/display/displaypage.js'/>">
</script>
<script>
jQuery(function(){
		jQuery("#displayallpage").val(${displayallpage});
		jQuery("#tz").val(${thispage});
	});
</script>
<div class="box_big">
<form:form commandName="quick" method="post" action="${ctx}/quick/queryquick.html?method=select" id="searchForm">
	<div class="bj_biao" onclick="hiddenselectcon();"><h4><fmt:message key="user.selectcon"/></h4></div>
	<div class="box5" id="selectcondiv" style="display: none;">
	<table  border="0" cellspacing="0" cellpadding="0" class="table_cx2">
		<tr height="18">
			<th width="100">
				<fmt:message key="quick.satellite"/>:
			</th>
			<td width="200">
				<form:select path="satelliteid" cssClass="text4">
					<option value=""><fmt:message key="common.pleaseselect"/></option>
					<c:forEach var="c" items="${satelliteids}">
						<form:option value="${c}">${c}</form:option>
					</c:forEach>
				</form:select>
			</td>
			<th width="190">
				<fmt:message key="quick.sensor"/>:
			</th>
			<td width="350">
				<form:select path="sensorid" cssClass="text4">
					<option value=""><fmt:message key="common.pleaseselect"/></option>
					<c:forEach var="c" items="${sensoridlist}">
						<form:option value="${c}">${c}</form:option>
					</c:forEach>
				</form:select>
			</td>
			<td>
				<input type="submit" value="<fmt:message key="button.search"/>" class="btn_blue2"/>
			</td>
		</tr>
	</table>
	</div>
</form:form>
<form id="deleteform" method="post"></form>

<display:table name="quicklist" cellspacing="0" cellpadding="0" requestURI="" style="width:100%;" id="quicks" pagesize="${pagesize}" class="table_cx" export="true" size="${resultSize}" partialList="true">
	<display:column property="datasetid" escapeXml="true" sortable="true" titleKey="quick.id" style="border-left:1px solid #feb808;"/>
	<display:column property="satelliteid" escapeXml="true" sortable="true" titleKey="quick.satellitename" maxLength="12"/>
	<display:column property="sensorid" escapeXml="true" sortable="true" titleKey="quick.sensorname"/>
	<display:column property="receivestationid" escapeXml="true" sortable="true" titleKey="quick.receivestationid"/>
	<display:column property="archivetime" sortable="true" titleKey="quick.archivetime" format="{0,date,yyyy-MM-dd HH:mm:ss}"/>
	<display:column property="orbitid" escapeXml="true" sortable="true" titleKey="quick.orbitid" style="border-right:1px solid #feb808;"/>
	<%--<display:column escapeXml="true" titleKey="user.islocked">
		<c:if test="${users.islocked != null}">
			<c:if test="${users.islocked eq '1'}"><fmt:message key="user.locked"/></c:if>
			<c:if test="${users.islocked eq '2'}"><fmt:message key="user.nolocked"/></c:if>
		</c:if>
	</display:column>
	--%>
	<display:column titleKey="quick.operate" autolink="true" media="html">
		<a href="${ctx}/quick/showquick.html?operate=show&datasetid=${quicks.datasetid}"><fmt:message key="quick.view"/></a>
		<a href="#" onclick="onDelete(${quicks.datasetid});"><fmt:message key="quick.delete"/></a>
		<c:forEach var="map" items="${quicks.viewstring}">
		<a href="${ctx}/lookquick.html?operate=quicklook&datasetid=${quicks.datasetid}&sensor=${map.key}" target="_blank"><fmt:message key="quick.preview"/>${map.key}</a>
		</c:forEach>
	</display:column>
    <display:setProperty name="export.pdf" value="false" />
	<display:setProperty name="export.csv" value="false" /> 
	<display:setProperty name="export.xml" value="false" /> 
</display:table>
</div>
<script type="text/javascript">
    highlightTableRows("quicks");
    function onDelete(id)
    {
    	var msg = "<fmt:message key="quick.deletemsg"/>";
    	ans = confirm(msg);
    	if(ans)
   		{
	    	var form = document.getElementById("deleteform");
	    	form.action = "${ctx}/quick/deletequick.html?id="+id;
	    	form.submit();
   		}
    }
    
jQuery("#satelliteid").change(function(){
  	var checkText=jQuery("#satelliteid").find("option:selected").text();  
 	jQuery.post("${ctx}/ajax/getsensors.html?method=ajax",{key:checkText},function(data){
 		try {
 			jQuery("#sensorid option[id='old']").remove(); 
 			jQuery.each(data.ingredients,function(idx,item){  
 				jQuery("#sensorid").append("<option id='old' >"+item+"</option>");  
              });  
         } catch(e)
         {
            alert("Error in XML response:"+e);  
         }  
 	},'JSON');
 });
</script>